package com.dubbo.impl;

import com.dubbo.model.Order;
import com.dubbo.service.OrderService;
import com.dubbo.service.ShopService;


/**
 * @author LING
 * 购物实现类
 */
public class ShopServiceImpl implements ShopService {
    /**
     * 得到订单服务代理对象
     */
    private OrderService orderService;

    public OrderService getOrderService() {
        return orderService;
    }

    public void setOrderService(OrderService orderService) {
        this.orderService = orderService;
    }

    @Override
    public Order buyGoods(Integer userId, String goodsName, Double price, Integer amount) {
        Order order = orderService.addOrder(userId, goodsName, price, amount);
        return order;
    }
}
